<!--
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-05-25 14:34:27
 * @LastEditors: Jun
 * @LastEditTime: 2021-05-29 15:23:51
-->
<template>
  <el-table :data="tableData" style="width: 100%">
    <!-- 单元格 -->
    <el-table-column
      v-for="(item, idx) of propArray"
      :key="idx"
      :prop="item.prop"
      :label="item.label"
    ></el-table-column>

    <!-- 操作 -->
    <el-table-column fixed="right" label="操作">
      <template slot-scope="scope">
        <slot :data="scope.row" :idx="scope.$index"></slot>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    tableData: {
      //表格数据
      type: Array,
      required: true,
    },
    propArray: {
      //prop和label数据
      type: Array,
      required: true,
    }
  },
};
</script>

<style lang="scss" scoped>
// 去除底部边框样式
.el-table::before {
  height: 0;
}

/deep/.el-table__fixed-right::before,
.el-table__fixed::before {
  height: 0;
}
</style>